#ifndef SETTINGS_H
#define SETTINGS_H

#include <QWidget>
#include <QCheckBox>
#include <QLineEdit>

namespace Ui {
    class Settings;
}

enum ControlStatus {
	CONTROL_ON,
	CONTROL_OFF
};

class Settings : public QWidget {
    Q_OBJECT

public:
	/* functions */
    explicit Settings(QWidget *parent = 0);
    ~Settings();

	QString getCameraIp();
	int getCameraPort();
	QString getImagePath();
	bool getGpioSetting();
	bool getLanSetting();
	QString getLogPath();
	bool getOcrControlSetting();
	bool getScannerControlSetting();
	bool getTagControlSetting();
	bool getCapControlSetting();
	int getTagCapErrorSetting();
	int getOcrErrorSetting();
    QString getCodePort();
	void setCameraIp(QString newCameraIp);
	void setCameraPort(int newCameraPort);
	void setImagePath(QString newImagePath);
	void setGpioSetting(bool checked);
	void setLanSetting(bool checked);
	void setLogPath(QString newLogPath);
	void setOcrControlSetting(bool newOcrControlSetting);
	void setScannerControlSetting(bool newScannerControlSetting);
	void setTagControlSetting(bool newTagControlSetting);
	void setCapControlSetting(bool newCapControlSetting);
	void setTagCapErrorSetting(int newTagCapError);
	void setOcrErrorSetting(int newOcrError);
    void setCodePort(QString port);

	void enableCameraTab();
	void enableDiagnosticTab();
	void enableAdvancedTab();
	void disableCameraTab();
	void disableDiagnosticTab();
	void disableAdvancedTab();

	void updateLabelAndButton(int which, ControlStatus controlStatus);

public slots:
	void okClicked();
	void cancelClicked();
	void ocrClicked();
	void scannerClicked();
	void tagClicked();
	void capClicked();
	void showImagePathDialog();
	void showLogPathDialog();
	void checkCameraTab();
	void checkDiagnosticTab();
	void checkAdvancedTab();

signals:
	void getSettings();

private:
    Ui::Settings *ui;
	bool ocrControlSetting;
	bool scannerControlSetting;
	bool tagControlSetting;
	bool capControlSetting;
};

#endif // SETTINGS_H
